<%--
  Created by IntelliJ IDEA.
  User: qiwenyong
  Date: 2024/10/23
  Time: 11:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!DOCTYPE html>
<html>

<head>
    <link href="${pageContext.request.contextPath}//css/bootstrap.css" rel="stylesheet" media="screen">
    <link href="${pageContext.request.contextPath}//css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
    <script type="text/javascript" src="${pageContext.request.contextPath}//js/jquery.min.js" charset="UTF-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}//js/bootstrap.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}//js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}//js/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
</head>

<body>
<div style="padding:5px; margin:0px;">
    <ul class="breadcrumb" style="  margin:0px; ">
        <li>
            <a href="product_list.html">商品管理</a>
        </li>
        <li>修改商品</li>
    </ul>
</div>

<form action="${pageContext.request.contextPath}/ProductUpdateByIdServlet" class="form-horizontal" method="post">
    <input type="hidden" name="id" value="${product.id}">
    <!--开始 -->
    <div class="row">
        <div class="col-sm-6">

            <div class="form-group">
                <label class="col-sm-3 control-label">商品名称</label>
                <div class="col-sm-9">
                    <input type="text" name="name" value="${product.name}" class="form-control input-sm" value="牛肉堡" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商品类型</label>
                <div class="col-sm-4">
                    <select class="form-control" name="category">
                        <option value="">--请选则---</option>
                        <option value="图书" ${product.category=='图书'?'selected':''}>图书</option>
                        <option value="水果" ${product.category=='水果'?'selected':''}>水果</option>
                        <option value="衣服" ${product.category=='衣服'?'selected':''}>衣服</option>
                        <option value="手机" ${product.category=='手机'?'selected':''}>手机</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">商品价格</label>
                <div class="col-sm-9">
                    <input type="number" name="price" value="${product.price}" class="form-control input-sm"  value="15"/>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">商品库存</label>
                <div class="col-sm-9">
                    <input type="number" name="stock" value="${product.stock}" class="form-control input-sm" value="60"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商品状态</label>
                <div class="col-sm-9">
                    <input type="radio" value="1" name="state" ${product.state=='1'?'checked':''}>可售
                    <input type="radio" value="0" name="state" ${product.state=='0'?'checked':''}>禁售
                </div>
            </div>

        </div>
    </div>
    <!--结束 -->
    <div class="row">
        <div class="col-sm-3 col-sm-offset-2">
            <input type="submit" class="btn btn-success" value="提交" />
            <a class="btn btn-warning" href="product_list.html">返回上一级</a>
        </div>
    </div>
</form>

<script type="text/javascript">
    $('.form_date').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0,
        format: 'yyyy-mm-dd'
    });
</script>
</body>

</html>
